/*
Problem Id:2680  User Id:Latex 
Memory:4012K  Time:515MS
Language:G++  Result:Accepted

Source 
*/
#include <stdio.h>
#include <string.h>

int ans[1010][1000];

int temp[1000];
int jie2[1000];
int to[1000];

void add(int *s1, int *s2, int *answer)
{
	int i, len;
	memset(to, 0, sizeof(to));
	len = s1[0] > s2[0] ? s1[0] : s2[0];
	for (i=1; i<=len; ++i)
	{
		to[i] += s1[i]+s2[i];
		if (to[i]>9)
		{
			to[i+1] += to[i]/10;
			to[i] %= 10;
		}
	}
	while (to[len+1]!=0) len++;
	for (i=1; i<=len; ++i)
		answer[i] = to[i];
	answer[0] = len;
	
}

void output(int a)
{
	int i;
	for (i=ans[a][0]; i>=1;--i)
		printf("%d", ans[a][i]);
	printf("\n");
}
void out(int *a)
{
	int i;
	for (i=a[0]; i>=1;--i)
		printf("%d", a[i]);
	printf("\n");
	
}

int main()
{
	int i;
	//init
	memset(ans, 0, sizeof(ans));
	memset(temp, 0, sizeof(temp));	
	memset(jie2, 0, sizeof(jie2));
	
	ans[0][0]=1; ans[0][1] = 0;
	ans[1][0]=1; ans[1][1] = 0;
	ans[2][0]=1; ans[2][1] = 1;
	ans[3][0]=1; ans[3][1] = 1;	

	jie2[0] = 1; jie2[1] = 1;
	for (i=4; i<=1000; ++i)
	{
		add(jie2, jie2, jie2);
		add(jie2, ans[i-2], ans[i]);
	/*	printf("now counting %d:\n",i);
		printf("jie=");
		out(jie2);
		printf("ans[i-2]=");
		out(ans[i-2]);
		printf("ans[i]=");
		printf("\n");
		out(ans[i]);*/

	}
	while (scanf("%d", &i)!=EOF)
	{
		output(i);
	}
	
	return 0;	
}


